package com.esiag.isidis.fi.pdsTeam.jms.consumer;

import java.io.Serializable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.ObjectMessage;

import com.esiag.isidis.fi.pdsTeam.annotation.Queue;
import com.esiag.isidis.fi.pdsTeam.jms.connection.AbstractConnectionFactory;
import com.esiag.isidis.fi.pdsTeam.jms.connection.ConnectionActiveMQ;


public abstract class ActiveMQConsumer extends AbstractConsumerFactory<Serializable>{

	public ActiveMQConsumer(Class msgClass) {
		super(msgClass);
	}

	@Override
	public AbstractConnectionFactory getConnection(Class msgClass)
			throws JMSException {
		return new ConnectionActiveMQ(msgClass);
	}

	@Override
	public String getQueue(Class msgClass) {
		Queue queue=(Queue) msgClass.getAnnotation(Queue.class);
		if(queue!=null) return queue.value();
		return null;
	}
	
	
}
